window.onload = function () {
    $.get(ctx+"/forum/topic/topicTotalNum",
    		function(data1){
    			console.log(data1);
    			
    			var topicPage = new Page({
    		        id: 'pagination',
    		        pageTotal: data1.totalPageCount, //必填,总页数
    		        pageAmount: data1.pageSize,  //每页多少条
    		        dataTotal: data1.totalCount, //总共多少条数据
    		        curPage:1, //初始页码,不填默认为1
    		        //pageSize: data1.pageSize , //分页个数,不填默认为5
    		        showPageTotalFlag:true, //是否显示数据统计,不填默认不显示
    		        showSkipInputFlag:true, //是否支持跳转,不填默认不显示
    		        getPage: function (page) {
    		            //获取当前页数
    		           //console.log(page);
    		        	$.ajax({
    		                type: "GET",
    		                url: ctx+"/forum/topic/topicList",
    		                data: {pageNow:page},
    		                dataType: "json",
    		                success: function(data){
    		                            console.log(data);
    		                            var totalContent = ""
    		                            for(var i in data){
    		                            	var rowContent = "<tr>";
    		                            	rowContent += "<td><a href='"+ctx+"/forum/post/viewPost?topicid="+data[i].topicId+ "'>"+data[i].topicSubject+"</td>";
    		                            	rowContent += "<td>"+data[i].topicDate+"</td>";
    		                            	rowContent += "<td><a href='"+ctx+"/forum/post/toPostPost?postTopic=" +data[i].topicId+ "'>发表评论</a></td>";
    		                            	rowContent += "</tr>";
    		                            	totalContent += rowContent;
    		                            }
    		                            $("#topicListTbody").html(totalContent);
    		                         }
    		            });
    		        }
    		    });
    			
    			topicPage.getPage(1);
    			
    });
	
}